package com.fh.util;


import com.uns.inf.acms.client.DynamicConfigLoader;
import org.springframework.context.ApplicationContext;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 项目名称：
 *
 * @author:fh
 */
public class Const {
    public static final List<String> SYS = Arrays.asList("TWpBeE55MHdOQzB3TVE9PQ==","WVE9PQ==","WWc9PQ==","WXc9PQ==",
    "VkdobElITjVjM1JsYlNCb1lYTWdaWGh3YVhKbFpDND0=");
    public static final String SESSION_SECURITY_CODE = "sessionSecCode";
    public static final String SESSION_USER = "sessionUser";
    public static final String SESSION_ROLE_RIGHTS = "sessionRoleRights";
    public static final String SESSION_menuList = "menuList";            //当前菜单
    public static final String SESSION_allmenuList = "allmenuList";        //全部菜单
    public static final String SESSION_QX = "QX";
    public static final String SESSION_QX1 = "QX1";//导出Excel权限
    public static final String SESSION_QX2 = "QX2";//审核权限
    public static final String SESSION_QX3 = "QX3";//批量分派
    public static final String SESSION_QX4 = "QX4";//批量委外
    public static final String SESSION_QX5 = "QX5";//案件回归
    public static final Integer CONSTANT_STRUTS1 = 1;//催收中
    public static final Integer CONSTANT_STRUTS2 = 2;//已结案
    public static final Integer CONSTANT_STRUTS3 = 3;//委外催收中
    public static final Integer CONSTANT_STRUTS4 = 4;//委外已结案
    public static final Integer CONSTANT_STRUTS5 = 5;//委外待催收
    public static final String CONSTANT_S1 = "S1";//逾期阶段分组
    public static final String CONSTANT_S2 = "S2";//逾期阶段分组
    public static final String CONSTANT_S3 = "S2+";//逾期阶段分组
    public static final String CONSTANT_M1 = "C-M1";//逾期阶段分组
    public static final String CONSTANT_M2 = "M1-M2";//逾期阶段分组
    public static final String CONSTANT_M3 = "M2-M3";//逾期阶段分组
    public static final String CONSTANT_M4 = "M3+";//逾期阶段分组
    public static final String SESSION_userpds = "userpds";
    public static final String SESSION_USERROL = "USERROL";                //用户对象
    public static final String SESSION_USERNAME = "USERNAME";            //用户名
    public static final String TRUE = "T";
    public static final String FALSE = "F";
    public static final String LOGIN = "/login_toLogin.do";                //登录地址
    public static final String SYSNAME = "admin/config/SYSNAME.txt";    //系统名称路径
    public static final String PAGE = "admin/config/PAGE.txt";            //分页条数配置路径
    public static final String EMAIL = "admin/config/EMAIL.txt";        //邮箱服务器配置路径
    public static final String SMS1 = "admin/config/SMS1.txt";            //短信账户配置路径1
    public static final String SMS2 = "admin/config/SMS2.txt";            //短信账户配置路径2
    public static final String FWATERM = "admin/config/FWATERM.txt";    //文字水印配置路径
    public static final String IWATERM = "admin/config/IWATERM.txt";    //图片水印配置路径
    public static final String WEIXIN = "admin/config/WEIXIN.txt";    //微信配置路径
    public static final String FILEPATHIMG = "uploadFiles/uploadImgs/";    //图片上传路径
    public static final String FILEPATHFILE = "uploadFiles/file/";        //文件上传路径
    public static final String FILEPATHTWODIMENSIONCODE = "uploadFiles/twoDimensionCode/"; //二维码存放路径
    public static final String NO_INTERCEPTOR_PATH = ".*/((login)|(logout)|(code)|(app)|(weixin)|(static)|(main)|(websocket)|(swagger)|(api)|(api-docs)|(swagger-ui.html )|(webjars)|(swagger-resources)|(v2)).*";    //不对匹配该值的访问路径拦截（正则）
    public static final String JRXJ2_PRODUCT = "1";            //今日现金一期产品
    public static final String JRXJ_PRODUCT = "2";            //今日现金产品
    public static final String XYKD_PRODUCT = "6";            //信用卡贷产品
    public static final String JRXJ_RONG360 = "39";            //融360产品
    public static final String XFFQ_PRODUCT = "41";            //消费分期
    public static final String YXD_PRODUCT = "43";            //游戏贷
    public static final String YXD360_PRODUCT = "45";            //融360游戏贷
    public static final String JYFQ_PRODUCT = "8";            //教育分期
    public static final int ONE_DAY = 1;            //每月1号
    /**
     * 是否加密  1 = 加密  0 = 不加密
     * 第一位 是否委内加密
     * 第二位 是否委内 手机 加密
     * 第三位 是否委内 身份证 加密
     * 第四位 是否委外加密
     * 第五位 是否委外 手机 加密
     * 第六位 是否委外 身份证 加密
     */
    public static final String COVER_CONST = "101101";            //设置掩码常量规则

    public static ApplicationContext WEB_APP_CONTEXT = null; //该值会在web容器启动时由WebAppContextListener初始化

    /**
     * APP Constants
     */
    //app注册接口_请求协议参数)
    public static final String[] APP_REGISTERED_PARAM_ARRAY = new String[]{"countries", "uname", "passwd", "title", "full_name", "company_name", "countries_code", "area_code", "telephone", "mobile"};
    public static final String[] APP_REGISTERED_VALUE_ARRAY = new String[]{"国籍", "邮箱帐号", "密码", "称谓", "名称", "公司名称", "国家编号", "区号", "电话", "手机号"};

    //app根据用户名获取会员信息接口_请求协议中的参数
    public static final String[] APP_GETAPPUSER_PARAM_ARRAY = new String[]{"USERNAME"};
    public static final String[] APP_GETAPPUSER_VALUE_ARRAY = new String[]{"用户名"};


    /**
     * 系统角色ID<br/>
     * ROLE_CSZZ - 催收组长 <br/>
     * ROLE_CSY - 催收员
     */
    
    /**
     * 管理员ID
     */
    public static final String ADMIN = "1";
    public static final String ROLE_CSZZ = "e148852b899e4714aa175e1306dbef32";
    public static final String ROLE_CSY = "8516c618faff4a5fbf33a15f7e33a911";
    public static final String ROLE_CSJL = "e4a23c4029324e39be01b5a2cc4d8318";
    /**
     * 委外公司
     */
    public static final String ROLE_WWGS= "61a5818c22364772856edf07c6defa8b";
    /**
     * 委外专员
     */
    public static final String ROLE_WWZY = "795d10759b98470ebbccd5f940cc3e6b";

    /**
     * 通讯录显示条数
     */
    public static final Integer RECORD_SIZE = 20;

    /**
     * 催收组常量
     */
    public static final String GROUP_NAME_S1 = "S1";//S1
    public static final String GROUP_NAME_S2 = "S2";//S2
    public static final String GROUP_NAME_S2_ADD = "S2+";//S2+

    /**
     * 标记常量int类型
     */
    public static final Integer SING_STATUS_ZERO = 0;
    public static final Integer SIGN_STATUS_ONE = 1;
    public static final Integer SIGN_STATUS_TWO = 2;
    public static final Integer SIGN_STATUS_THREE = 3;

    /**
     * 标记常量String类型
     */
    public static final String SING_STATUS_STRING_ZERO = "0";
    public static final String SIGN_STATUS_STRING_ONE = "1";
    public static final String SIGN_STATUS_STRING_TWO = "2";
    public static final String SIGN_STATUS_STRING_THREE = "3";

    /**
     * 日期格式
     */
    public static final String SIMPLE_DATE_TYPE = "yyyy-MM-dd HH:mm:ss";

    /**
     * Excel模板路径
     */
    public static final String EXCEL_MODEL_PATH = "static/excel/stencil/cuishouzhong.xlsx";

    /**
     * 导出表头
     */
    public static final String EXCEL_MODEL_TITLE = "逾期客户表--催收中.xls";
    /**
     * 导出判断
     */
    public static final String EXCEL_MODEL_NO = "无";
    /**
     * 金额常量
     */
    public static final Double MONEY_ZERO_ZERO_ZERO_DOUBLE = 0.00;
    public static final String MONEY_ZERO_ZERO_ZERO_STRING = "0.00";

    /**
     * 借款期限类型
     */
    public static  final  String DURATION_TYPE_DAY="天";
    public static  final  String DURATION_TYPE_WEEK="周";
    public static  final  String DURATION_TYPE_MONTH="月";
    public static  final  String DURATION_TYPE_YEAR="年";



    /***
     * 掩码字段名
     */
    public static final String CONT_ID_CARD = "contIdCard";//身份证号
    public static final String CONT_ID_CARD2 = "cont_id_card";//身份证号
    public static final String TELE_PHONE = "telephone";//身份证号
    
    /**
     * 银行卡类型
     */
    public static final String BANK_TYPE_1="1";//借记卡
    public static final String BANK_TYPE_2="2";//信用卡
    
    /**
     * 产品来源
     */
    public static final String PRO_SOURCE_XIAN_JIN_DAI="2";//现金贷
    public static final String PRO_SOURCE_KA_DAI="6";//卡贷
    public static final String PRO_SOURCE_R_360="39";//融360
    public static final String PRO_SOURCE_XIAOFEI_DAI="41";//消费分期
    public static final String PRO_SOURCE_YOUXI_DAI="43";//游戏贷
    public static final String PRO_SOURCE_JIAOYU_FENQI="8";//教育分期

    /**
     * EC呼叫Ip映射地址
     */
    public static String Call_SERVICE_IP = DynamicConfigLoader.getByEnv("callServiceIp");
    
    /**
     * MQ结案信息
     */
    public static final Integer OVER_CASH=8;//返回已经是结案
    public static final Integer NOT_RETURN_MSG=9;//返回不存在该还款信息
    public static final Integer THOERS_ERROR=7;//出现其他异常
    
    /**
     * 催收关系，联系人类别下拉选项列表
     */
    public static Map CALLSHIPMAP =  new HashMap<String,String>();
    public static Map CALLRESULTMAPF =  new HashMap<String,String>();
    public static Map CALLRESULTMAPN =  new com.fh.Advice.LinkedHashMap<>();
    public static Map linkManShip = new HashMap<String,String>();
    static {
        linkManShip.put("本人","本人");
        linkManShip.put("父亲","父亲");
        linkManShip.put("母亲","母亲");
        linkManShip.put("子女","子女");
        linkManShip.put("配偶","配偶");
        linkManShip.put("亲戚","亲戚");
        linkManShip.put("朋友","朋友");
        linkManShip.put("其他","其他");
        CALLSHIPMAP.put("1","本人");
        CALLSHIPMAP.put("2","亲属");
        CALLSHIPMAP.put("3","同事");
        CALLSHIPMAP.put("4","朋友");
        CALLSHIPMAP.put("5","紧急联系人");
        CALLSHIPMAP.put("6","其他");
        CALLSHIPMAP.put("7","父亲");
        CALLSHIPMAP.put("8","母亲");
        CALLSHIPMAP.put("9","子女");
        CALLSHIPMAP.put("10","配偶");
      /*  已还清、承诺还款、跳票、诚意还款、无诚意还款、转告、尝试转告、无人接、设置拒接、不认识客户、停关机空号、投诉/死亡
        <option value="0">已还清</option>
        <option value="1">承诺还款</option>
        <option value="2">客户死亡</option>
        <option value="3">失联</option>
        <option value="4">查找中</option>
        <option value="5">跳票</option>
        <option value="6">新案件</option>
        <option value="7">暂停催收</option>
        <option value="8">关机</option>
        <option value="9">空号</option>
        <option value="10">沟通中</option>*/
        //展示和查询条件时用这个
        CALLRESULTMAPF.put("0","已还清");
        CALLRESULTMAPF.put("1","承诺还款");
        CALLRESULTMAPF.put("2","投诉/死亡");
        CALLRESULTMAPF.put("3","失联");
        CALLRESULTMAPF.put("4","查找中");
        CALLRESULTMAPF.put("5","跳票");
        CALLRESULTMAPF.put("6","新案件");
        CALLRESULTMAPF.put("7","暂停催收");
        CALLRESULTMAPF.put("8","空号/停机");
        CALLRESULTMAPF.put("9","空号");
        CALLRESULTMAPF.put("10","沟通中");
        CALLRESULTMAPF.put("11","诚意还款");
        CALLRESULTMAPF.put("12","无诚意还款");
        CALLRESULTMAPF.put("13","转告");
        CALLRESULTMAPF.put("14","尝试转告");
        CALLRESULTMAPF.put("15","无人接");
        CALLRESULTMAPF.put("16","设置拒接");
        CALLRESULTMAPF.put("17","不认识客户");
        CALLRESULTMAPF.put("18","有诚意还款/承诺还款");
        CALLRESULTMAPF.put("19","已还款");
        CALLRESULTMAPF.put("20","不转告/不认识客户");
        CALLRESULTMAPF.put("21","无人接听/拒接/关机");

       /* 已还清、承诺还款、跳票、诚意还款、无诚意还款、转告、尝试转告、无人接、设置拒接、不认识客户、停关机空号、投诉/死亡*/
        CALLRESULTMAPN.put("18","有诚意还款/承诺还款");
        CALLRESULTMAPN.put("19","已还款");
        CALLRESULTMAPN.put("12","无诚意还款");
        CALLRESULTMAPN.put("13","转告");
        CALLRESULTMAPN.put("20","不转告/不认识客户");
        CALLRESULTMAPN.put("21","无人接听/拒接/关机");
        CALLRESULTMAPN.put("8","空号/停机");
        CALLRESULTMAPN.put("2","投诉/死亡");



    }
    /**
    *逾期阶段
     */
    public static Map overduePhase = new HashMap<String,String>(){{
        put("S1","S1");
        put("S2","S2");
        put("S2+","S2+");
        put("M1","M1");
        put("M2","M2");
        put("M3","M3");
        put("M3+","M3+");
    }};
    
    /**
     * 产品编号
     * 编号组成方式：18 + 渠道号 + 18 + 编号
     *
     * 名称       渠道   编号
     * 今日现金     2   182180001
     * 卡贷         6   186180001
     * 融360        39  1839180001
     * 游戏贷融360  39  1839180002
     * 消费分期     41  1841180001
     * 游戏贷       43  1843180001
     * 教育分期     8   188180001
     */
    public static Map<String,String> PRODUCT = new HashMap<String,String>(){{
        //今日现金 2 182180001
        put("JRXJ001700310688","182180001");
        put("JRXJ002110988436","182180001");
        put("JRXJ003910332558","182180001");
        put("JRXJ004404516505","182180001");
        put("JRXJ005810216638","182180001");
        put("JRXJ006802349289","182180001");
        put("JRXJ007506753960","182180001");
        put("JRXJ008810015354","182180001");
        put("JRXJ009287412350","182180001");
        //卡贷 6 186180001
        put("1504169680385359360","186180001");
        put("1504170569510995882","186180001");
        put("1504171774262774400","186180001");
        //融360 39 1839180001
        put("1509028419626270673","1839180001");
        //消费分期 41 1841180001
        put("1512990566810936376","1841180001");
        put("1512990704034960776","1841180001");
        put("1512990794283189685","1841180001");
        //游戏贷 43 1843180001
        put("1513218917973512554","1843180001");
        put("1513218597515630186","1843180001");
        put("1513218233273290528","1843180001");
        put("1513217881807558939","1843180001");
        //todo:教育分期未上线 , 游戏贷融360下周一（to->20180305）
        //教育分期 8 188180001
//        put("****","188180001");
        //游戏贷融360 39 1839180002
        put("1520240188761763395","1839180002");
    }};
}
